{% extends 'base.html' %}
{% load static %}

{% block body %}
<div>
    <div class="container">
        <div style="margin-bottom: 10px;margin-top: -10px;">
            <a style="border: 1px solid black;padding: 5px;border-radius: 3px;color: green;" href="/number/add/">
                <span class="glyphicon glyphicon-plus-sign">添加号码</span>
            </a>
            <div style="float: right; width: 500px;margin-top: -7px;">
                <form method="get">
                    <div class="input-group">
                        <input type="text" name="query_param" class="form-control" placeholder="请输入搜索内容..."
                            value="{{query}}">
                        <span class="input-group-btn">
                            <button class="btn btn-default" type="submit"
                                style="width: 100px;background-color: aliceblue;">
                                <span class="glyphicon glyphicon-search"></span>
                            </button>
                        </span>
                    </div>
                </form>
            </div>
        </div>
        <div class="panel panel-default" style="background-color: rgb(241, 238, 233);">
            <div class="panel-heading">
                <span class="glyphicon glyphicon-th-list"></span>
                号码信息
            </div>
            <table class="table">
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>号码</th>
                        <th>价格</th>
                        <th>等级</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    {% for num in queryset.object_list %}
                    <tr>
                        <td>{{forloop.counter}}</td>
                        <td>{{num.mobile}}</td>
                        <td>{{num.price}}</td>
                        <td>{{num.get_level_display}}</td>
                        <td>{{num.get_status_display}}</td>
                        <td>
                            <a style="border: 1px solid black;padding: 1px;border-radius: 3px;z-index: 1;"
                                href="/number/edit/{{num.id}}/">
                                <span class="glyphicon glyphicon-edit" >编辑</span>
                            </a>
                            <a style="border: 1px solid black;padding: 1px;border-radius: 3px;color: red;margin-left: 5px;"
                                href="/number/delete/?nid={{num.id}}">
                                <span class="glyphicon glyphicon-minus-sign">删除</span>
                            </a>
                            <a style="border: 1px solid black;padding: 1px;border-radius: 3px;color: rgb(143, 101, 101);margin-left: 5px;"
                                href="/num/delete/?nid={{num.id}}">
                                <span class="glyphicon glyphicon-shopping-cart">购买</span>
                            </a>
                        </td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
            <div style="display: flex;justify-content: center;">
                {% include 'page.html' %}
            </div>
        </div>
    </div>
</div>
<link rel="stylesheet" href="{% static page.css%}">
{% endblock body %}